{include file="public/header" /}
<body>

<div class="layui-fluid">

    <div class="layui-card" >



        <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="layadmin-userfront-formlist">
            <div class="layui-form-item">

                <div class="layui-inline">
                    <label class="layui-form-label">用户名</label>

                    <div class="layui-input-block">
                        <input class="layui-input" name="username" id="username" autocomplete="off">
                    </div>

                </div>
                <a class="layui-btn" data-type="reload" id="reload">搜索</a>

            </div>

        </div>

        <table class="layui-table" id="tableEvent" lay-data=""  lay-filter="tableEvent">

        </table>


    </div>

</div>



{include file="public/footer" /}
<script>
    layui.use(['table','form'], function(){
        var $ = layui.$
            ,table = layui.table
            ,form = layui.form;


        var username =$("#username").val();
        table.render({
            elem: '#tableEvent'
            ,url: "{:url('Logaction/ajaxGetSyslog')}" //数据接口,
            ,page: true
            ,where:{username:username}    //向后台传递参数
            //,toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
            ,parseData: function(res){ //res 即为原始返回的数据
                return res;

            },cols: [[ //表头
                {align:'center',field: 'id', title: '序号',width:100}
                ,{align:'center',field: 'username', title: '用户名',width:100}
                ,{align:'center',field: 'msg', title: '操作',width:500}
                ,{align:'center',field: 'module', title: '模块'}
                ,{align:'center',field: 'controller', title: '控制器'}
                ,{align:'center',field: 'action', title: '方法'}
                ,{align:'center',field: 'method', title: '请求方式'}
                ,{align:'center',field: 'create_time', title: '操作时间'}
            ]]
            ,id: 'testReload'
            ,done: function(res, curr, count){
                //merge2(res);
            }
        });

        $('#reload').on('click', function(){
            var username =$("#username").val();

            table.reload('testReload', {
                where: { //设定异步数据接口的额外参数，任意设
                    username: username
                }
                ,page: {
                    curr: 1 //重新从第 1 页开始
                }
            }); //只重载数据
        });


    });



</script>
</body>
</html>
